package com.mojo.concurrent.concurrent_09_threadlocal;

/**
 * 可继承ThreadLocal
 *
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class InheritableThreadLocalDemo1 {
    public static void main(String[] args) {
        InheritableThreadLocal<Object> local = new InheritableThreadLocal<>();
        local.set("local variable");
        new Thread(() -> {
            System.out.println("子线程获取线程局部变量:" + local.get());
            local.remove();
        }).start();

    }
}
